<%@ page import="sige.Contrato" %>
<!doctype html>
<html>
    <head>
        <meta name="layout" content="main">
        <g:set var="entityName" value="${message(code: 'contrato.label', default: 'Contrato')}" />
        <title><g:message code="default.show.label" args="[entityName]" /></title>
    </head>
    <body>
        <center>
          <h1><g:message code="default.show.label" args="[entityName]" /></h1>
        </center>
        <ul class="breadcrumb">
            <li>
                <a href="${createLink(uri: '/')}">
                  <i class="icon-home"></i>
                  <g:message code="default.home.label"/>
                </a>
                <span class="divider"> . </span>
            </li>
            <li>
                <g:link action="list">
                    <i class="icon-list"></i>
                    <g:message code="default.list.label" args="[entityName]" />
                </g:link>
                <span class="divider"> . </span>
            </li>
        </ul>
        <div id="show-contrato" class="content scaffold-show" role="main">
            
            <g:if test="${flash.message}">
              <div class="alert alert-info">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                ${flash.message}
              </div>
            </g:if>
            <div class="span8 offset3">
                <div class="span8 well">   
                <ol>
                    <g:if test="${contratoInstance?.aluno}">
				    <li class="fieldcontain">
					    <span id="aluno-label" class="property-label"><g:message code="contrato.aluno.label" default="Aluno" /></span>
					    <span aria-labelledby="aluno-label">
					        <g:link controller="aluno" action="show" id="${contratoInstance?.aluno?.id}">
					            ${contratoInstance?.aluno?.nome?.encodeAsHTML()}
					        </g:link>
					    </span>
				    </li>
				    </g:if>
			
				    <g:if test="${contratoInstance?.responsavel}">
				    <li class="fieldcontain">
					    <span id="responsavel-label" class="property-label"><g:message code="contrato.responsavel.label" default="Responsavel" /></span>
					    <span class="property-value" aria-labelledby="responsavel-label">
					        <g:link controller="responsavel" action="show" id="${contratoInstance?.responsavel?.id}">
					            ${contratoInstance?.responsavel?.nome?.encodeAsHTML()}
					        </g:link>
				        </span>
					
				    </li>
				    </g:if>
			
				    <g:if test="${contratoInstance?.turma}">
				    <li class="fieldcontain">
					    <span id="ano-label" class="property-label"><g:message code="contrato.turma.label" default="Turma" /></span>
					    <span class="property-value" aria-labelledby="turma-label"><g:link controller="turma" action="show" id="${contratoInstance?.turma?.id}">${contratoInstance?.turma?.encodeAsHTML()}</g:link></span>
				    </li>
				    </g:if>
			
				    <g:if test="${contratoInstance?.anulacao}">
				    <li class="fieldcontain">
					    <span id="anulacao-label" class="property-label"><g:message code="contrato.anulacao.label" default="Anulacao" /></span>
					    <span class="property-value" aria-labelledby="anulacao-label"><g:link controller="anulacaoDeMatricula" action="show" id="${contratoInstance?.anulacao?.id}">${contratoInstance?.anulacao?.encodeAsHTML()}</g:link></span>
					</li>
				    </g:if>
			
				    <li class="fieldcontain">
					    <span id="ativo-label" class="property-label"><g:message code="contrato.ativo.label" default="Ativo" /></span>
					    <span class="property-value" aria-labelledby="ativo-label"><g:formatBoolean boolean="${contratoInstance?.ativo}" /></span>
					</li>
			
				    <g:if test="${contratoInstance?.dataDaMatricula}">
				    <li class="fieldcontain">
					    <span id="dataDaMatricula-label" class="property-label"><g:message code="contrato.dataDaMatricula.label" default="Data Da Matricula" /></span>
					    <span class="property-value" aria-labelledby="dataDaMatricula-label"><g:formatDate date="${contratoInstance?.dataDaMatricula}" /></span>
					</li>
				    </g:if>
				    
				    <g:if test="${contratoInstance?.anuidade}">
				    <li >
					    <span id="anuidade-label" class="property-label"><g:message code="contrato.dataDaMatricula.label" default="Data Da Matricula" /></span>
					    <span><g:link controller="pagamento" action="list_por_movimentacao" id="${contratoInstance?.anuidade?.id}">Mensalidades</g:link></span>
					</li>
				    </g:if>
                </ol>
                </div>
                <g:form>
                    <fieldset class="form-actions span8">
                        <g:hiddenField name="id" value="${contratoInstance?.id}" />
                        <g:link class="btn btn-warning" action="edit" id="${contratoInstance?.id}">
                            <i class="icon-edit icon-white"></i>
                            <g:message code="default.button.edit.label" default="Edit" />
                        </g:link>
                        <g:if test="${! contratoInstance?.anulacao}">
                        <g:link class="btn btn-danger" controller="anulacaoDeMatricula" action="create" params="['contrato.id': contratoInstance?.id]">
                            <i class="icon-ban-circle icon-white"></i>
                            <g:message code="contrato.anular.matricula.label" default="Anular Matrícula" /> 
                        </g:link>
                        </g:if>
                        <g:if test="${contratoInstance?.responsavel == null}">
                        <g:link class="btn btn-success" controller="responsavel" action="create" id="${contratoInstance?.id}">
                            <i class="icon-check icon-white"></i>
                            <g:message code="contrato.inserir.responsavel.label" default="Inserir Responsável" />
                        </g:link>
                        </g:if>
                        <g:if test="${contratoInstance?.responsavel != null}">
                        <g:link class="btn" action="imprime" id="${contratoInstance?.id}" target="new">
                            <i class="icon-print"></i>
                            <g:message code="aluno.preparar.impressao.label" default="Preparar Impressão" />
                        </g:link>
                        </g:if>
                    </fieldset>
                </g:form>
            </div><!--/span8-->
        </div><!--/show-contrato-->
    </body>
</html>

